import React from 'react'
import chain from '@/test/chain-function/index.js'
import classNames from '@/test/classnames/index.js'

let flag = true
let str = 'hhh'
let Box = classNames('box', { 'open': flag, 'close': !flag })

let Body = classNames('body', ['demo', ], str)

function Demo () {
  this.name = 'defore'
}

let demo = new Demo()

console.log('demo\'s name', demo.name) // defore
Demo.prototype.age = 24
console.log('demo\'s age', demo.age) // 24

class Test extends React.Component {
  componentDidMount() {
    let count = 0
    chain(
      function (step) { count += step },
      function (step) { count += step },
      function (step) { count += step },
    )(1)
    console.log(count)
  }
  render() {
    return (
      <div>
        <h3 className={Box}>test</h3>
        <div className={Body}>body</div>
      </div>
    )
  }
}

export default Test
